.class public Lcom/clarkehackworth/SamsungGalaxySUnlock/SDCardSaveData;
.super Ljava/lang/Object;
.source "SDCardSaveData.java"

# interfaces
.implements Lcom/clarkehackworth/SamsungGalaxySUnlock/ISaveData;


# instance fields
.field private context:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 16
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 17
    iput-object p1, p0, Lcom/clarkehackworth/SamsungGalaxySUnlock/SDCardSaveData;->context:Landroid/content/Context;

    .line 18
    return-void
.end method


# virtual methods
.method public SaveData(Ljava/lang/String;)V
    .locals 5
    .parameter "data"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    .prologue
    const-string v4, "IO Error"

    .line 25
    :try_start_0
    new-instance v1, Ljava/io/FileOutputStream;

    iget-object v2, p0, Lcom/clarkehackworth/SamsungGalaxySUnlock/SDCardSaveData;->context:Landroid/content/Context;

    const v3, 0x7f040012

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/lang/String;)V

    .line 26
    .local v1, save:Ljava/io/FileOutputStream;
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/io/FileOutputStream;->write([B)V

    .line 27
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->flush()V

    .line 28
    invoke-virtual {v1}, Ljava/io/FileOutputStream;->close()V
    :try_end_0
    .catch Ljava/io/FileNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1

    .line 34
    return-void

    .line 29
    .end local v1           #save:Ljava/io/FileOutputStream;
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 30
    .local v0, e:Ljava/io/FileNotFoundException;
    new-instance v2, Ljava/lang/Exception;

    const-string v3, "IO Error"

    invoke-direct {v2, v4}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v2

    .line 31
    .end local v0           #e:Ljava/io/FileNotFoundException;
    :catch_1
    move-exception v2

    move-object v0, v2

    .line 32
    .local v0, e:Ljava/io/IOException;
    new-instance v2, Ljava/lang/Exception;

    const-string v3, "IO Error"

    invoke-direct {v2, v4}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    throw v2
.end method
